<template>
	<view class="navbar-frame" :style="{
		height: `${menuInfo.contentTop}px`,
		backgroundColor: `rgba(255, 255, 255, ${opacity})`,
		boxShadow: `0 0 3px -1px rgba(100, 100, 100, ${opacity})`
	}">
		<view 	class="navbar-content" 
				:style="{
					top: `${menuInfo.menuTop}px`,
					height: `${menuInfo.menuHeight}px`,
					width: `calc(100% - ${menuInfo.menuWidth}px - 60rpx)`
				}">
			<view class="image-frame">
				<image class="image-logo" src="/static/icon/logo.png" mode="heightFix"></image>
			</view>
			<view class="image-frame">
				<image class="image-text" src="/static/icon/logo_text.png"></image>
				<image 	class="image-texts" 
						src="/static/icon/logo_text_black.png" 
						:style="{
							opacity: opacity
						}"></image>
			</view>
			<view class="search-frame">
				<view class="search-content">
					点击此处溯源
				</view>
				<view class="search-contents" :style="{
							opacity: opacity
						}">
					点击此处溯源
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	const app = getApp()
	export default {
		name:"navbar",
		data() {
			return {
				menuInfo: app.globalData.menuInfo
			};
		},
		props: {
			opacity: {
				type: Number,
				default: 0
			}
		},
		watch: {
			opacity() {}
		},
		mounted() {
			// console.log(this.menuInfo)
		}
	}
</script>

<style lang="scss" scoped>
	.navbar-frame {
		position: fixed;
		width: 100%;
		top: 0;
		left: 0;
		z-index: 10;
		.navbar-content {
			width: 100%;
			position: absolute;
			left: 30rpx;
			display: flex;
			.image-frame {
				height: 100%;
				display: flex;
				align-items: center;
				position: relative;
				.image-logo {
					height: 90%;
				}
				.image-text {
					height: 70%;
					width: 84.1931034483px;
					margin-left: 10px;
				}
				.image-texts {
					width: 84.1931034483px;
					height: 70%;
					margin-left: 10px;
					position: absolute;
				}
			}
			.search-frame {
				height: 100%;
				flex: 1;
				display: flex;
				justify-content: center;
				align-items: center;
				position: relative;
				.search-content {
					width: 70%;
					height: 70%;
					border-radius: 999px;
					border: 1px solid #fff;
					font-size: 13px;
					display: flex;
					justify-content: center;
					align-items: center;
					color: #fff;
				}
				.search-contents {
					width: 70%;
					height: 70%;
					border-radius: 999px;
					border: 1px solid #666;
					font-size: 13px;
					display: flex;
					justify-content: center;
					align-items: center;
					color: #333;
					position: absolute;
				}
			}
		}
	}
</style>